from Test import AbstractTest
from MySocket import User, Event
'''
1. Connect a user to the system and present its id
2. The user should be automatically removed after some time
'''
class TestRemoveOfflineUsers(AbstractTest):
    def __init__(self):
        test_name = "Remove Offline Users Test"
        super(TestRemoveOfflineUsers, self).__init__(test_name)

    def run(self):
        user_1 = User()
        user_1.connect()
        user_1.mysend("1\n")
        # if it blocks here or returns something else then fail
        if(user_1.myreceive(1) != ""):
        	return False
       	return True